package com.hitemole.objects;

import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.hitemole.interfaces.IInteractableObject;

public class InteractableGameObject extends GameObject implements IInteractableObject{

	protected Rectangle collisionShape = new Rectangle();
	protected int collisionType;
	protected boolean interaction;
	protected float xScale,yScale;
	
	public InteractableGameObject(String name, TextureRegion image,
			Vector2 position, float xScale, float yScale) {
		super(name, image, position);
		// TODO Auto-generated constructor stub
		this.interaction=true;
		this.collisionShape.x=position.x;
		this.collisionShape.y=position.y;
		this.collisionShape.width=image.getRegionWidth();
		this.collisionShape.height=image.getRegionHeight();
		this.xScale=xScale;
		this.yScale=yScale;
	}

	@Override
	public Rectangle getCollisionShape() {
		// TODO Auto-generated method stub
		return collisionShape;
	}

	@Override
	public int getCollisionType() {
		// TODO Auto-generated method stub
		return collisionType;
	}

	@Override
	public boolean isInteractable() {
		// TODO Auto-generated method stub
		return interaction;
	}

	@Override
	public void setInteraction(Boolean interaction) {
		// TODO Auto-generated method stub
		this.interaction=interaction;
	}
	
	public Rectangle getRelativeCollisionShape() {
		// TODO Auto-generated method stub
		return new Rectangle(position.x*xScale,position.y*yScale,collisionShape.width*xScale,collisionShape.height*yScale);
	}

	public void setScale(float xScale2, float yScale2) {
		// TODO Auto-generated method stub
		this.xScale=xScale2;
		this.yScale=yScale2;
	}

}
